package com.fnzn.entranceGuard.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.fnzn.entranceGuard.entity.GuardDeviceRecord;
import com.fnzn.entranceGuard.mapper.GuardDeviceRecordMapper;
import com.fnzn.entranceGuard.service.IGuardDeviceRecordService;
import com.github.pig.common.constant.CommonConstant;
import com.github.pig.common.util.R;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 * 设备问题记录 服务实现类
 * </p>
 *
 * @author xiaosa
 * @since 2018-10-15
 */
@Service
public class GuardDeviceRecordServiceImpl extends ServiceImpl<GuardDeviceRecordMapper, GuardDeviceRecord> implements IGuardDeviceRecordService {

    @Override
    public void addObj(GuardDeviceRecord guardDeviceRecord) {
        try {
            guardDeviceRecord.setCreateTime(new Date());
            guardDeviceRecord.setStatus(GuardDeviceRecord.STATUS_RESOLVED);
            guardDeviceRecord.setDelFlag(CommonConstant.STATUS_NORMAL);
            super.insert(guardDeviceRecord);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
